package com.jlc.first;

import java.io.IOException;


import java.io.Writer;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


public class LoginServlet extends HttpServlet {
	protected void service(HttpServletRequest req,HttpServletResponse res)throws ServletException,IOException{
		String unm=req.getParameter("uname");
		String pwd=req.getParameter("pass");
		//Interact with DB to verify the Data
		String msg="";
		if(unm.equals(pwd)){
		msg="Login success<br>This is home page";
		}else{
			msg="Username or password is invalid<br>Try Again";
		}
		Writer out=res.getWriter();
		out.write("<html><body bgcolor='red'><center><font color='white' size='7'><b>"+msg+"</b></font></center></body>");
	}
}
